<template>
	<!-- 消息页面 -->
	<view>
		<view class="searchBar">
			<image @click="goOne" src="../../static/左键.png" mode=""></image>
			<text>颠沛</text>
			<image src="../../static/更多.png" mode=""></image>
		</view>
		<view class="chat" >
			<view class="left" v-for="item in ltData">
				<image :src="item.commentsHeadPortrait" mode=""></image>
				<text>{{item.commentsTalk}}</text>
			</view>
			<view class="right" v-for="item in ltData1">
				<text>{{item.commentsTalk1}}</text>
				<image :src="item.commentsHeadPortrait1" mode=""></image>
			</view>
		</view>
		<view class="comment">
			<image src="../../static/语音1.png" mode=""></image>
			<view class="yaya">
				<input type="text" v-model="usersay"  placeholder="  发消息..." >
				<image @click="sendUsersay" src="../../static/发送(1).png" mode=""></image>
			</view>
			<image src="../../static/表情.png" mode=""></image>
			<image src="../../static/加.png" mode=""></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				usersay: "",
				ltData:[
					{
					commentsHeadPortrait: '/static/mm.png',
					commentsTalk:'你好！',
					},
					{
					commentsHeadPortrait: '/static/mm.png',
					commentsTalk:'在吗？',
					}
				],
				ltData1:[
					{
					commentsHeadPortrait1: '/static/w6.png',
					commentsTalk1:'你好！',
					},
					{
					commentsHeadPortrait1: '/static/w6.png',
					commentsTalk1:'在的亲',
					}
				]
			}
		},
		methods: {
			sendUsersay() {
				console.log(this.ltData1);
				this.ltData1.push({
					commentsHeadPortrait1: '/static/w6.png',
					commentsTalk1:this.usersay,
				})
			},
			goOne() {
				uni.switchTab({
					url: "../news/news"
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	@import "add.scss"
</style>